package com.scalar.chiptrack.marketing;

import com.scalar.chiptrack.utils.StringUtils;

public class Pricing {

  // ----------------------------------------------------- Instance Variables
  
  private int productId = -1;
  private int customerId = -1;
  private String fromQty = null;
  private String toQty = null;
  //private float price = 0.0f;
  // modified by varma(1 july 2004)
  private double price = 0.0;
  private int sample = -1;

  private String mktPartNo              = null;
  private String mktPartNoDesc          = null;
  private double samplePriceRange[][]   = null;
  private int quater                    = -1;
  private int    year                   = -1;
  private double regularPriceRange[][]  = null;
  /**
   * Default Constructor
   *
   */
  public Pricing() {

  }

  /**
   * Constructor
   *
   */
  public Pricing(int productId, String fromQty, String toQty, double price) {
      this.productId = productId;
      this.fromQty = fromQty;
      this.toQty = toQty;
      this.price = price;
      
  }
  
  public Pricing(int productId, int customerId, String fromQty, String toQty, double price, int sample ) {
      this.productId = productId;
      this.customerId = customerId;
      this.fromQty = fromQty;
      this.toQty = toQty;
      this.price = price;
      this.sample= sample;
  }
  public Pricing(int productId, String fromQty, String toQty, double price, int sample) {
      this.productId = productId;
      this.fromQty = fromQty;
      this.toQty = toQty;
      this.price = price;
      this.sample=sample;
  }
  // ----------------------------------------------------- Public Methods
  
  public int getProductId()
  {
      return productId;
  }
  
  public void setProductId(int productId)
  {
      this.productId = productId;
  }
  
  public int getCustomerId()
  {
      return customerId;
  }
  
  public void setCustomerId(int customerId)
  {
      this.customerId = customerId;
  }
  
  public String getFromQty()
  {
      return fromQty;
  }
  
  public void setFromQty(String fromQty)
  {
      this.fromQty = fromQty;
  }
  
  public String getToQty()
  {
      return toQty;
  }
  
  public void setToQty(String toQty)
  {
      this.toQty = toQty;
  }
  
  /*public float getPrice()
  {
      return price;
  }
  
  public void setPrice(float price)
  {
      this.price = price;
  }*/
  //modified by varma(1 july 2004)
  public double getPrice()
  {
      return price;
  }

  public void setPrice(double price)
  {
      this.price = price;
  }

  // Added Krishna Prasad on 11 May 2004 , to Display the Price field in currency format in 'View Price' Screen
  public String getPriceAsString()
  {
    return StringUtils.formatAmount( this.price,"$###,###.##");
  }


    public int getSample() {
        return sample;
    }


    public String getMktPartNo() {
        return mktPartNo;
    }

    public void setMktPartNo(String mktPartNo) {
        this.mktPartNo = mktPartNo;
    }

    public String getMktPartNoDesc() {
        return mktPartNoDesc;
    }

    public void setMktPartNoDesc(String mktPartNoDesc) {
        this.mktPartNoDesc = mktPartNoDesc;
    }


    public double[][] getSamplePriceRange() {
        return samplePriceRange;
    }

    public void setSamplePriceRange(double[][] samplePriceRange) {
        this.samplePriceRange = samplePriceRange;
    }

    public int getQuater() {
        return quater;
    }

    public void setQuater(int quater) {
        this.quater = quater;
    }

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public double[][] getRegularPriceRange() {
        return regularPriceRange;
    }

    public void setRegularPriceRange(double[][] regularPriceRange) {
        this.regularPriceRange = regularPriceRange;
    }

    public String toString()
    {

        StringBuffer buf = new StringBuffer();

        buf.append( "[ Part Number = " ).append( mktPartNo );
        for ( int i = 0; i<samplePriceRange.length; i++ )
        {
           buf.append( "] \n[Sample PRice = " ).append( samplePriceRange[i][0] ).append("]");
           buf.append( "] \n[Sample PRice = " ).append( samplePriceRange[i][1] ).append("]");
           buf.append( "] \n[Sample PRice = " ).append( samplePriceRange[i][2] ).append("]");
        }
        System.out.println("********************************************************");
        for ( int i = 0; i<regularPriceRange.length; i++ )
        {
           buf.append( "] \n[Regular PRice = " ).append( regularPriceRange[i][0] ).append("]");
           buf.append( "] \n[Regular PRice = " ).append( regularPriceRange[i][1] ).append("]");
           buf.append( "] \n[Regular PRice = " ).append( regularPriceRange[i][2] ).append("]");
        }
        buf.append( "] [Year = " ).append( year );
        buf.append( "] [Quater = " ).append( quater ).append("]");

        return buf.toString();
    }
}
